package com.csx.orm.mybatis.service;

import com.csx.orm.mybatis.mapper.UserAnnotationMapper;
import com.csx.orm.mybatis.mapper.UserMapper;
import com.csx.orm.mybatis.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private UserAnnotationMapper userAnnotationMapper;

    public List<User> getAllUsers() {
        return userMapper.getAllUsers();
    }

    public User getUserById(Long id) {
        return userMapper.getUserById(id);
    }

    public void createUser(User user) {
        userMapper.createUser(user);
    }

    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    public void deleteUser(Long id) {
        userMapper.deleteUser(id);
    }

    public List<User> getUsersByCondition(User userCondition) {
        return userMapper.getUsersByCondition(userCondition);
    }

    public List<User> getUsersUseTrim(User user) {
        return userMapper.getUsersUseTrim(user);
    }

    public List<User> getUsersUseChoose(User user) {
        return userMapper.getUsersUseChoose(user);
    }

    public List<User> getUsersUseForeach(List<Long> ids) {
        return userMapper.getUsersUseForeach(ids);
    }

    public List<User> getUsersUseBind(User user) {
        return userMapper.getUsersUseBind(user);
    }

    public List<User> getUsersUseSql() {
        return userMapper.getUsersUseSql();
    }

    public List<User> getUsersByConditionSql(User user) {
        return userMapper.getUsersByConditionSql(user);
    }

    public void updateUserUseSet(User user) {
        userMapper.updateUserUseSet(user);
    }

    public void updateUserUseTrim(User user) {
        userMapper.updateUserUseTrim(user);
    }

    public List<User> getUsersResultMapNoArgs() {
        return userMapper.findUsersResultMapNoArgs();
    }
    public List<User> getUsersResultMapArgs() {
        return userMapper.findUsersResultMapArgs();
    }

    public List<User> getUsersResultMapQuote() {
        return userMapper.findUsersResultMapQuote();
    }

    public List<User> getUserResultMapExtends() {

        return userMapper.findUserResultMapExtends();
    }
    public List<User> getUserResultMapDiscriminator() {
        return userMapper.findUserResultMapDiscriminator();
    }


    public List<User> findAll() {
        return userAnnotationMapper.findAll();
    }

    public User findById(Long id) {
        return userAnnotationMapper.findById(id);
    }

    public List<User> findUsersByCondition(User condition) {
        return userAnnotationMapper.findUsersByCondition(condition);
    }

    public List<User> findUsersResults() {
        return userAnnotationMapper.findUsersResults();
    }

    public List<User> findAllResultsReuse() {
        return userAnnotationMapper.findAllResultsReuse();
    }

    public int save(User user) {
        return userAnnotationMapper.save(user);
    }

    public int saveUseGeneratedKeys(User user) {
        return userAnnotationMapper.saveUseGeneratedKeys(user);
    }

    public int updateById(User user) {
        return userAnnotationMapper.updateById(user);
    }
    public int deleteById(Long id) {
        return userAnnotationMapper.deleteById(id);
    }


    public List<User> findConditionSelectProvider(User condition) {
        return userAnnotationMapper.findConditionSelectProvider(condition);
    }

    public int saveInsertProvider(User user) {
        return userAnnotationMapper.saveInsertProvider(user);
    }

    public int saveInsertProviderColumns(User user) {
        return userAnnotationMapper.saveInsertProviderColumns(user);
    }


    public int updateUpdateProvider(User user) {
        return userAnnotationMapper.updateUpdateProvider(user);
    }


    public int deleteDeleteProvider(Long id) {
        return userAnnotationMapper.deleteDeleteProvider(id);
    }
}
